package com.gzwanchuang.xhgj.ui.view;


import android.annotation.SuppressLint;
import android.content.Context;
import android.util.AttributeSet;
import android.widget.TextView;

import androidx.annotation.Nullable;
import androidx.databinding.BindingAdapter;

import com.gzwanchuang.xhgj.ui.utils.CountdownUtils;

/**
 * 文件名 : mytextView
 * 创建者 : MangoWang
 * 创建日期 : 2019/12/23 15:02
 * 微信 : MangoWaWang
 * 邮箱 : 763482205@qq.com
 * 描述 : TODO
 */
@SuppressLint("AppCompatCustomView")
public class DaoShuTextView extends TextView {

    public CountdownUtils countdownUtils;

    public DaoShuTextView(Context context) {
        super(context);
    }

    public DaoShuTextView(Context context, @Nullable AttributeSet attrs) {
        super(context, attrs);
        countdownUtils = new CountdownUtils(this,null);
    }


    @BindingAdapter("startDaoCode")
    public static void setStartDaoCode(DaoShuTextView customLayout, boolean value) {
        if (customLayout != null) {
            if (value) {
                customLayout.countdownUtils.RunTimer();
            } else {
                customLayout.countdownUtils.cancle();
            }
        }
    }
}
